import '@/utils/console.js' //去掉打印语句
import Vue from 'vue'
import App from './App.vue'
import router from './router'
import store from './store'
import hljs from 'highlight.js'
import 'highlight.js/styles/default.css' //代码高亮的样式
import 'amfe-flexible' // 引入flexible.js
import directiveObj from './utils/directiveObj'
import './VueCommponent.js' //vant组件注册，单独分离成一个js文件，让main.js更清晰
import axios from 'axios'

Vue.use(directiveObj)

Vue.config.productionTip = false

// #在main.js定义自定义指令 
//高亮效果
Vue.directive('highlight',function (el) {
  let blocks = el.querySelectorAll('pre code');
  blocks.forEach((block)=>{
    hljs.highlightBlock(block)
  })
})

new Vue({
    router,
    store,
    render: (h) => h(App)
}).$mount('#app')

// 使用代理服务器
// axios({
//     url: 'api/nc/article/headline/T1348647853363/0-40.html'
// }).then((res) => {
//     console.log(res)
// })